{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>command</th>\n",
       "      <th>pid</th>\n",
       "      <th>cpu</th>\n",
       "      <th>time</th>\n",
       "      <th>value</th>\n",
       "      <th>event</th>\n",
       "      <th>calls</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>2597</td>\n",
       "      <td>cycles</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>638</td>\n",
       "      <td>instructions</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>20880</td>\n",
       "      <td>cpu-clock</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>8</td>\n",
       "      <td>ll_cache_miss</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>14</td>\n",
       "      <td>ll_cache</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576881</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1569431</td>\n",
       "      <td>mem_access</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576882</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>6751</td>\n",
       "      <td>branch-load-misses</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576883</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1101842</td>\n",
       "      <td>branch-loads</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576884</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>464</td>\n",
       "      <td>dTLB-load-misses</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576885</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1695943</td>\n",
       "      <td>dTLB-loads</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>576886 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         command  ...                                              calls\n",
       "0           perf  ...  [ffffc312b729e578 generic_exec_single+0x104 ([...\n",
       "1           perf  ...  [ffffc312b729e578 generic_exec_single+0x104 ([...\n",
       "2           perf  ...  [ffffc312b729e578 generic_exec_single+0x104 ([...\n",
       "3           perf  ...  [ffffc312b729e578 generic_exec_single+0x104 ([...\n",
       "4           perf  ...  [ffffc312b729e578 generic_exec_single+0x104 ([...\n",
       "...          ...  ...                                                ...\n",
       "576881  skiplist  ...  [ffffc312b744cd5c free_unref_page_prepare.part...\n",
       "576882  skiplist  ...  [ffffc312b744cd5c free_unref_page_prepare.part...\n",
       "576883  skiplist  ...  [ffffc312b744cd5c free_unref_page_prepare.part...\n",
       "576884  skiplist  ...  [ffffc312b744cd5c free_unref_page_prepare.part...\n",
       "576885  skiplist  ...  [ffffc312b744cd5c free_unref_page_prepare.part...\n",
       "\n",
       "[576886 rows x 7 columns]"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pipa.parser.perf_script_call import PerfScriptData\n",
    "\n",
    "df = PerfScriptData.from_file(\"perf.script\").to_raw_dataframe()\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import re\n",
    "import pandas as pd\n",
    "df[\"callee\"] = df[\"calls\"].apply(lambda x: x[0] if isinstance(x, list) and len(x) > 0 else None)\n",
    "pattern = re.compile(r\"([0-9a-f]+)\\s+(.+?)\\s+\\((.+)\\)\")\n",
    "\n",
    "def parse_callee(line):\n",
    "    matches = pattern.findall(line)\n",
    "    if matches:\n",
    "        addr, symbol, caller = matches[0]\n",
    "        return pd.Series([addr, symbol, caller])\n",
    "    else:\n",
    "        return pd.Series([None, None, None])\n",
    "\n",
    "df[['addr', 'symbol', 'caller']] = df['callee'].apply(parse_callee)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>command</th>\n",
       "      <th>pid</th>\n",
       "      <th>cpu</th>\n",
       "      <th>time</th>\n",
       "      <th>value</th>\n",
       "      <th>event</th>\n",
       "      <th>calls</th>\n",
       "      <th>callee</th>\n",
       "      <th>addr</th>\n",
       "      <th>symbol</th>\n",
       "      <th>caller</th>\n",
       "      <th>offset</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>2597</td>\n",
       "      <td>cycles</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "      <td>ffffc312b729e578 generic_exec_single+0x104 ([k...</td>\n",
       "      <td>ffffc312b729e578</td>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>638</td>\n",
       "      <td>instructions</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "      <td>ffffc312b729e578 generic_exec_single+0x104 ([k...</td>\n",
       "      <td>ffffc312b729e578</td>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>20880</td>\n",
       "      <td>cpu-clock</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "      <td>ffffc312b729e578 generic_exec_single+0x104 ([k...</td>\n",
       "      <td>ffffc312b729e578</td>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>8</td>\n",
       "      <td>ll_cache_miss</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "      <td>ffffc312b729e578 generic_exec_single+0x104 ([k...</td>\n",
       "      <td>ffffc312b729e578</td>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>perf</td>\n",
       "      <td>17438</td>\n",
       "      <td>4</td>\n",
       "      <td>155414.791807</td>\n",
       "      <td>14</td>\n",
       "      <td>ll_cache</td>\n",
       "      <td>[ffffc312b729e578 generic_exec_single+0x104 ([...</td>\n",
       "      <td>ffffc312b729e578 generic_exec_single+0x104 ([k...</td>\n",
       "      <td>ffffc312b729e578</td>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x104</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576881</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1569431</td>\n",
       "      <td>mem_access</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "      <td>ffffc312b744cd5c free_unref_page_prepare.part....</td>\n",
       "      <td>ffffc312b744cd5c</td>\n",
       "      <td>free_unref_page_prepare.part.0</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576882</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>6751</td>\n",
       "      <td>branch-load-misses</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "      <td>ffffc312b744cd5c free_unref_page_prepare.part....</td>\n",
       "      <td>ffffc312b744cd5c</td>\n",
       "      <td>free_unref_page_prepare.part.0</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576883</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1101842</td>\n",
       "      <td>branch-loads</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "      <td>ffffc312b744cd5c free_unref_page_prepare.part....</td>\n",
       "      <td>ffffc312b744cd5c</td>\n",
       "      <td>free_unref_page_prepare.part.0</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576884</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>464</td>\n",
       "      <td>dTLB-load-misses</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "      <td>ffffc312b744cd5c free_unref_page_prepare.part....</td>\n",
       "      <td>ffffc312b744cd5c</td>\n",
       "      <td>free_unref_page_prepare.part.0</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>576885</th>\n",
       "      <td>skiplist</td>\n",
       "      <td>17439</td>\n",
       "      <td>4</td>\n",
       "      <td>155462.993517</td>\n",
       "      <td>1695943</td>\n",
       "      <td>dTLB-loads</td>\n",
       "      <td>[ffffc312b744cd5c free_unref_page_prepare.part...</td>\n",
       "      <td>ffffc312b744cd5c free_unref_page_prepare.part....</td>\n",
       "      <td>ffffc312b744cd5c</td>\n",
       "      <td>free_unref_page_prepare.part.0</td>\n",
       "      <td>[kernel.kallsyms]</td>\n",
       "      <td>0x4c</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>576886 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         command    pid  ...             caller offset\n",
       "0           perf  17438  ...  [kernel.kallsyms]  0x104\n",
       "1           perf  17438  ...  [kernel.kallsyms]  0x104\n",
       "2           perf  17438  ...  [kernel.kallsyms]  0x104\n",
       "3           perf  17438  ...  [kernel.kallsyms]  0x104\n",
       "4           perf  17438  ...  [kernel.kallsyms]  0x104\n",
       "...          ...    ...  ...                ...    ...\n",
       "576881  skiplist  17439  ...  [kernel.kallsyms]   0x4c\n",
       "576882  skiplist  17439  ...  [kernel.kallsyms]   0x4c\n",
       "576883  skiplist  17439  ...  [kernel.kallsyms]   0x4c\n",
       "576884  skiplist  17439  ...  [kernel.kallsyms]   0x4c\n",
       "576885  skiplist  17439  ...  [kernel.kallsyms]   0x4c\n",
       "\n",
       "[576886 rows x 12 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"offset\"] = df[\"symbol\"].str.split(\"+\").str[1]\n",
    "df[\"symbol\"] = df[\"symbol\"].str.split(\"+\").str[0]\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>103923343854</td>\n",
       "      <td>8.324178e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>13668446608</td>\n",
       "      <td>1.094832e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>1223390536</td>\n",
       "      <td>9.799261e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>1007650849</td>\n",
       "      <td>8.071204e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>992199593</td>\n",
       "      <td>7.947440e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>free_pages_and_swap_cache</td>\n",
       "      <td>2582658</td>\n",
       "      <td>2.068689e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>1023965</td>\n",
       "      <td>8.201879e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>22177</td>\n",
       "      <td>1.776360e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>5758</td>\n",
       "      <td>4.612112e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>1077</td>\n",
       "      <td>8.626685e-09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  ...         ratio\n",
       "0                SkipList<int, int>::find(int const&)  ...  8.324178e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  ...  1.094832e-01\n",
       "2                                            __random  ...  9.799261e-03\n",
       "3                                         _int_malloc  ...  8.071204e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...  ...  7.947440e-03\n",
       "..                                                ...  ...           ...\n",
       "86                          free_pages_and_swap_cache  ...  2.068689e-05\n",
       "87                                 security_mmap_file  ...  8.201879e-06\n",
       "88                             __set_cpus_allowed_ptr  ...  1.776360e-07\n",
       "89                                generic_exec_single  ...  4.612112e-08\n",
       "90                                       mutex_unlock  ...  8.626685e-09\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Group by 'event'\n",
    "event_groups = df.groupby(\"event\")\n",
    "\n",
    "d = dict()\n",
    "# Iterate over each event group\n",
    "for event, group in event_groups:\n",
    "    # Group by 'symbol' and sum 'value', then sort in descending order\n",
    "    symbol_group = group.groupby(\"symbol\")[\"value\"].sum().sort_values(ascending=False).reset_index()\n",
    "    symbol_group.columns = ['symbol', 'value_sum']\n",
    "    symbol_group[\"ratio\"] = symbol_group[\"value_sum\"] / symbol_group[\"value_sum\"].sum()\n",
    "    d[event] = symbol_group\n",
    "\n",
    "d[\"cycles\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dict_keys(['branch-load-misses', 'branch-loads', 'cpu-clock', 'cycles', 'dTLB-load-misses', 'dTLB-loads', 'instructions', 'l2d_cache', 'l2d_cache_refill', 'll_cache', 'll_cache_miss', 'mem_access'])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>40120565770</td>\n",
       "      <td>8.323471e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>5276749250</td>\n",
       "      <td>1.094722e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>472331100</td>\n",
       "      <td>9.799050e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>389036030</td>\n",
       "      <td>8.070998e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>383076240</td>\n",
       "      <td>7.947356e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>__mod_node_page_state</td>\n",
       "      <td>999060</td>\n",
       "      <td>2.072664e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>free_pages_and_swap_cache</td>\n",
       "      <td>995760</td>\n",
       "      <td>2.065818e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>31570</td>\n",
       "      <td>6.549558e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>10780</td>\n",
       "      <td>2.236435e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>2420</td>\n",
       "      <td>5.020567e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  ...         ratio\n",
       "0                SkipList<int, int>::find(int const&)  ...  8.323471e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  ...  1.094722e-01\n",
       "2                                            __random  ...  9.799050e-03\n",
       "3                                         _int_malloc  ...  8.070998e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...  ...  7.947356e-03\n",
       "..                                                ...  ...           ...\n",
       "86                              __mod_node_page_state  ...  2.072664e-05\n",
       "87                          free_pages_and_swap_cache  ...  2.065818e-05\n",
       "88                                generic_exec_single  ...  6.549558e-07\n",
       "89                             __set_cpus_allowed_ptr  ...  2.236435e-07\n",
       "90                                       mutex_unlock  ...  5.020567e-08\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"cpu-clock\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>30395631525</td>\n",
       "      <td>8.159185e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>4194898432</td>\n",
       "      <td>1.126048e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>381219192</td>\n",
       "      <td>1.023317e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>320525829</td>\n",
       "      <td>8.603965e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>306055043</td>\n",
       "      <td>8.215522e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>vma_gap_update</td>\n",
       "      <td>640162</td>\n",
       "      <td>1.718405e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>447523</td>\n",
       "      <td>1.201299e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>10386</td>\n",
       "      <td>2.787943e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>3533</td>\n",
       "      <td>9.483732e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>1020</td>\n",
       "      <td>2.738015e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  ...         ratio\n",
       "0                SkipList<int, int>::find(int const&)  ...  8.159185e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  ...  1.126048e-01\n",
       "2                                            __random  ...  1.023317e-02\n",
       "3                                         _int_malloc  ...  8.603965e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...  ...  8.215522e-03\n",
       "..                                                ...  ...           ...\n",
       "86                                     vma_gap_update  ...  1.718405e-05\n",
       "87                                 security_mmap_file  ...  1.201299e-05\n",
       "88                             __set_cpus_allowed_ptr  ...  2.787943e-07\n",
       "89                                generic_exec_single  ...  9.483732e-08\n",
       "90                                       mutex_unlock  ...  2.738015e-08\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"instructions\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>332490473</td>\n",
       "      <td>8.258299e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>45903600</td>\n",
       "      <td>1.140140e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>4185116</td>\n",
       "      <td>1.039487e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>3499848</td>\n",
       "      <td>8.692818e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>3330780</td>\n",
       "      <td>8.272892e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>free_pages_and_swap_cache</td>\n",
       "      <td>3657</td>\n",
       "      <td>9.083148e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>3409</td>\n",
       "      <td>8.467173e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>174</td>\n",
       "      <td>4.321760e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>39</td>\n",
       "      <td>9.686704e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>7</td>\n",
       "      <td>1.738639e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  332490473  8.258299e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...   45903600  1.140140e-01\n",
       "2                                            __random    4185116  1.039487e-02\n",
       "3                                         _int_malloc    3499848  8.692818e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    3330780  8.272892e-03\n",
       "..                                                ...        ...           ...\n",
       "86                          free_pages_and_swap_cache       3657  9.083148e-06\n",
       "87                                 security_mmap_file       3409  8.467173e-06\n",
       "88                             __set_cpus_allowed_ptr        174  4.321760e-07\n",
       "89                                generic_exec_single         39  9.686704e-08\n",
       "90                                       mutex_unlock          7  1.738639e-08\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"branch-load-misses\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>1136916774</td>\n",
       "      <td>8.288403e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>154652553</td>\n",
       "      <td>1.127455e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>14024831</td>\n",
       "      <td>1.022445e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>11589115</td>\n",
       "      <td>8.448750e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>11217270</td>\n",
       "      <td>8.177666e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>__tlb_remove_page_size</td>\n",
       "      <td>196</td>\n",
       "      <td>1.428888e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>__mod_node_page_state</td>\n",
       "      <td>173</td>\n",
       "      <td>1.261213e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>free_pages_and_swap_cache</td>\n",
       "      <td>130</td>\n",
       "      <td>9.477320e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>60</td>\n",
       "      <td>4.374148e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>10</td>\n",
       "      <td>7.290246e-09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>90 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol   value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  1136916774  8.288403e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...   154652553  1.127455e-01\n",
       "2                                            __random    14024831  1.022445e-02\n",
       "3                                         _int_malloc    11589115  8.448750e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    11217270  8.177666e-03\n",
       "..                                                ...         ...           ...\n",
       "85                             __tlb_remove_page_size         196  1.428888e-07\n",
       "86                              __mod_node_page_state         173  1.261213e-07\n",
       "87                          free_pages_and_swap_cache         130  9.477320e-08\n",
       "88                             __set_cpus_allowed_ptr          60  4.374148e-08\n",
       "89                                generic_exec_single          10  7.290246e-09\n",
       "\n",
       "[90 rows x 3 columns]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"dTLB-load-misses\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>36215203335</td>\n",
       "      <td>8.247872e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>4979405122</td>\n",
       "      <td>1.134040e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>452813929</td>\n",
       "      <td>1.031266e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>378351889</td>\n",
       "      <td>8.616817e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>361515099</td>\n",
       "      <td>8.233366e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>vma_gap_update</td>\n",
       "      <td>774057</td>\n",
       "      <td>1.762885e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>144700</td>\n",
       "      <td>3.295486e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>5431</td>\n",
       "      <td>1.236889e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>1727</td>\n",
       "      <td>3.933175e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>485</td>\n",
       "      <td>1.104569e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  ...         ratio\n",
       "0                SkipList<int, int>::find(int const&)  ...  8.247872e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  ...  1.134040e-01\n",
       "2                                            __random  ...  1.031266e-02\n",
       "3                                         _int_malloc  ...  8.616817e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...  ...  8.233366e-03\n",
       "..                                                ...  ...           ...\n",
       "86                                     vma_gap_update  ...  1.762885e-05\n",
       "87                                 security_mmap_file  ...  3.295486e-06\n",
       "88                             __set_cpus_allowed_ptr  ...  1.236889e-07\n",
       "89                                generic_exec_single  ...  3.933175e-08\n",
       "90                                       mutex_unlock  ...  1.104569e-08\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"dTLB-loads\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>1885392208</td>\n",
       "      <td>8.271481e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>251672187</td>\n",
       "      <td>1.104121e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>22618883</td>\n",
       "      <td>9.923222e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>18693322</td>\n",
       "      <td>8.201023e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>18413516</td>\n",
       "      <td>8.078268e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>__mod_node_page_state</td>\n",
       "      <td>39447</td>\n",
       "      <td>1.730595e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>27773</td>\n",
       "      <td>1.218441e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>786</td>\n",
       "      <td>3.448292e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>112</td>\n",
       "      <td>4.913597e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>6</td>\n",
       "      <td>2.632284e-09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol   value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  1885392208  8.271481e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...   251672187  1.104121e-01\n",
       "2                                            __random    22618883  9.923222e-03\n",
       "3                                         _int_malloc    18693322  8.201023e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    18413516  8.078268e-03\n",
       "..                                                ...         ...           ...\n",
       "86                              __mod_node_page_state       39447  1.730595e-05\n",
       "87                                 security_mmap_file       27773  1.218441e-05\n",
       "88                             __set_cpus_allowed_ptr         786  3.448292e-07\n",
       "89                                generic_exec_single         112  4.913597e-08\n",
       "90                                       mutex_unlock           6  2.632284e-09\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d['l2d_cache']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>851120558</td>\n",
       "      <td>8.306807e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>112031652</td>\n",
       "      <td>1.093412e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>10054671</td>\n",
       "      <td>9.813206e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>8226320</td>\n",
       "      <td>8.028763e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>8177065</td>\n",
       "      <td>7.980691e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>11918</td>\n",
       "      <td>1.163179e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>__mod_node_page_state</td>\n",
       "      <td>11881</td>\n",
       "      <td>1.159568e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>362</td>\n",
       "      <td>3.533065e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>31</td>\n",
       "      <td>3.025553e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>5</td>\n",
       "      <td>4.879924e-09</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  851120558  8.306807e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  112031652  1.093412e-01\n",
       "2                                            __random   10054671  9.813206e-03\n",
       "3                                         _int_malloc    8226320  8.028763e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    8177065  7.980691e-03\n",
       "..                                                ...        ...           ...\n",
       "86                                 security_mmap_file      11918  1.163179e-05\n",
       "87                              __mod_node_page_state      11881  1.159568e-05\n",
       "88                             __set_cpus_allowed_ptr        362  3.533065e-07\n",
       "89                                generic_exec_single         31  3.025553e-08\n",
       "90                                       mutex_unlock          5  4.879924e-09\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d['l2d_cache_refill']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>676920414</td>\n",
       "      <td>8.276299e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>90540920</td>\n",
       "      <td>1.106989e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>8147021</td>\n",
       "      <td>9.960873e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>6689785</td>\n",
       "      <td>8.179198e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>6606037</td>\n",
       "      <td>8.076805e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>__tlb_remove_page_size</td>\n",
       "      <td>12579</td>\n",
       "      <td>1.537959e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>__mod_node_page_state</td>\n",
       "      <td>11862</td>\n",
       "      <td>1.450295e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>7453</td>\n",
       "      <td>9.112335e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>165</td>\n",
       "      <td>2.017356e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>14</td>\n",
       "      <td>1.711696e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>90 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  676920414  8.276299e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...   90540920  1.106989e-01\n",
       "2                                            __random    8147021  9.960873e-03\n",
       "3                                         _int_malloc    6689785  8.179198e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    6606037  8.076805e-03\n",
       "..                                                ...        ...           ...\n",
       "85                             __tlb_remove_page_size      12579  1.537959e-05\n",
       "86                              __mod_node_page_state      11862  1.450295e-05\n",
       "87                                 security_mmap_file       7453  9.112335e-06\n",
       "88                             __set_cpus_allowed_ptr        165  2.017356e-07\n",
       "89                                generic_exec_single         14  1.711696e-08\n",
       "\n",
       "[90 rows x 3 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d['ll_cache']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>256798538</td>\n",
       "      <td>8.324681e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>32260212</td>\n",
       "      <td>1.045785e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>2860669</td>\n",
       "      <td>9.273479e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>change_pte_range</td>\n",
       "      <td>2468550</td>\n",
       "      <td>8.002340e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>2379985</td>\n",
       "      <td>7.715237e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>2657</td>\n",
       "      <td>8.613241e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>rand</td>\n",
       "      <td>654</td>\n",
       "      <td>2.120083e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>malloc@plt</td>\n",
       "      <td>629</td>\n",
       "      <td>2.039040e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>14</td>\n",
       "      <td>4.538403e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>8</td>\n",
       "      <td>2.593373e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>90 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  value_sum         ratio\n",
       "0                SkipList<int, int>::find(int const&)  256798538  8.324681e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...   32260212  1.045785e-01\n",
       "2                                            __random    2860669  9.273479e-03\n",
       "3                                    change_pte_range    2468550  8.002340e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...    2379985  7.715237e-03\n",
       "..                                                ...        ...           ...\n",
       "85                                 security_mmap_file       2657  8.613241e-06\n",
       "86                                               rand        654  2.120083e-06\n",
       "87                                         malloc@plt        629  2.039040e-06\n",
       "88                             __set_cpus_allowed_ptr         14  4.538403e-08\n",
       "89                                generic_exec_single          8  2.593373e-08\n",
       "\n",
       "[90 rows x 3 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d[\"ll_cache_miss\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>value_sum</th>\n",
       "      <th>ratio</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SkipList&lt;int, int&gt;::find(int const&amp;)</td>\n",
       "      <td>22718968566</td>\n",
       "      <td>8.231640e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SkipList&lt;int, int&gt;::insert(int const&amp;, int con...</td>\n",
       "      <td>3131548527</td>\n",
       "      <td>1.134637e-01</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>__random</td>\n",
       "      <td>284961310</td>\n",
       "      <td>1.032485e-02</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>_int_malloc</td>\n",
       "      <td>238629668</td>\n",
       "      <td>8.646139e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>int std::uniform_int_distribution&lt;int&gt;::operat...</td>\n",
       "      <td>227461107</td>\n",
       "      <td>8.241474e-03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>vma_gap_update</td>\n",
       "      <td>480868</td>\n",
       "      <td>1.742303e-05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>security_mmap_file</td>\n",
       "      <td>130090</td>\n",
       "      <td>4.713480e-06</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>__set_cpus_allowed_ptr</td>\n",
       "      <td>3988</td>\n",
       "      <td>1.444950e-07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>generic_exec_single</td>\n",
       "      <td>1452</td>\n",
       "      <td>5.260953e-08</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>mutex_unlock</td>\n",
       "      <td>415</td>\n",
       "      <td>1.503647e-08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>91 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                               symbol  ...         ratio\n",
       "0                SkipList<int, int>::find(int const&)  ...  8.231640e-01\n",
       "1   SkipList<int, int>::insert(int const&, int con...  ...  1.134637e-01\n",
       "2                                            __random  ...  1.032485e-02\n",
       "3                                         _int_malloc  ...  8.646139e-03\n",
       "4   int std::uniform_int_distribution<int>::operat...  ...  8.241474e-03\n",
       "..                                                ...  ...           ...\n",
       "86                                     vma_gap_update  ...  1.742303e-05\n",
       "87                                 security_mmap_file  ...  4.713480e-06\n",
       "88                             __set_cpus_allowed_ptr  ...  1.444950e-07\n",
       "89                                generic_exec_single  ...  5.260953e-08\n",
       "90                                       mutex_unlock  ...  1.503647e-08\n",
       "\n",
       "[91 rows x 3 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d['mem_access']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "for key, value in d.items():\n",
    "    value.to_csv(f\"./data/{key}.csv\", index=False)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "311",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
